package com.app.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;


// http://bUtils_Log.csdn.net/weiyage/article/details/8175108
public class ViewPagerCustom extends ViewPager {


    private boolean enabled = false;


    public ViewPagerCustom(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

//触摸没有反应就可以了
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (this.enabled) {
            return super.onTouchEvent(event);
        }
  
        return false;
    }


    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (this.enabled) {
            return super.onInterceptTouchEvent(event);
        }
 
        return false;
    }
 
    public void _setScanScroll(boolean enabled) {
        this.enabled = enabled;
    }
}
    



